#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
作者：sust_ly
功能：绘制分形树
版本：2.0
日期：2018/3/2
"""
import turtle
 
 
def draw_shu(length):
    if length >= 5:
        turtle.forward(length)
        turtle.right(20)
        draw_shu(length - 10)
        turtle.left(40)
        draw_shu(length - 10)
        turtle.right(20)
        turtle.backward(length)
 
 
def main():
    turtle.left(90)
    turtle.penup()
    turtle.backward(150)
    turtle.pendown()
    draw_shu(80)
    turtle.done()
 
 
if __name__ == "__main__":
    main()
